<?php
	session_start();
	$ip = $_SERVER['REMOTE_ADDR'];
	$uid = $_SESSION['userId'];
	$now = time('now');
	$time = $now;
	$succ = (is_logged_in()) ? 'Y' : 'N'; //if is logged in, return 'Y', else return 'N'
	$query =  "INSERT INTO usertracking (ipaddress,userid,time,successflag) VALUES ('".$ip."',".$uid.",".$time.",'".$succ."')";
	mysql_query($query,$connection);
?>